Early in the history of the AppleScript scripting language, the 3rd-party developers were allowed to extend its capabilities by creating scripting additions. Since then, many useful and valuable scripting additions have appeared on the market. This document's purpose is to give you an overview of what scripting additions are, and how easy it is to use them to enhance the value of your applications.
This text will give you a brief overview of using scripting additions with Mac OS X, but everything else, except for the installation instructions, also applies to older versions of Mac OS.
What is a Scripting Addition?
A scripting addition is a piece of software that extends the capabilities of AppleScript by adding new functions/commands. A scripting addition might be very limited in scope, or it may be a "suite" containing dozens of additional functions/commands. Scripting additions allow you to do things which would be otherwise impossible (or at least not contrived without difficulty!) using AppleScript's
built-in commands.
What is OSAX?
OSAX is just another name for scripting addition. It stands for Open Scripting Architecture eXtension. The common plural form is OSAXen.
What is a Dictionary?
Dictionary provides a list of all commands/functions defined by a scripting addition and it can be used as a quick reference manual. It is opened in Finder by double-click on the scripting addition file, or directly from the Script Editor under File/Open Dictionary.
Why Do I Need Scripting Additions?
AppleScript gives you the ability to quickly build elegant, easy-to-use, and easy-to-customize applications. However, since it is targeted to a large variety of users, several specific functions are either not included, or too generic. By enhancing AppleScript with scripting additions specific to your needs, you can solve your specific issues much more easily, effectively. Thus, you spend less time and money than if you were to reinvent the wheel by using strictly the AppleScript's built-in functionality.
What Scripting Additions Should I Choose?
Using a scripting addition is not always better than living without it. Before you buy a scripting addition, make sure that the Addition's vendor can offer quality future support for their Additions. Also make sure the scripting addition will actually make your work easier, not more difficult.
Note: All Scripting additions from 24U Software are easy to learn and easy to implement. 24U Software keeps developing new versions and new scripting additions since our first scripting addition was released in May 2001. Technical support by e-mail is available for free to all registered users.
Where Do I Install Scripting Additions?
For a scripting addition to be recognized by AppleScript, you have to put it into the ScriptingAdditions folder inside one of your Library folders. You may need to create a new "ScriptingAdditions" folder in the desired Library folder if it does not already exist. Make sure it's spelled "ScriptingAdditions" with no spaces. To make a scripting addition available to only yourself, it must be installed into your "/Users/UserName/Library" folder.
To make the scripting addition available to all users, you should install it into the root directory's "Library".
Scripting additions installation target on Mac OS X
How Do I Invoke Scripting Additions?
Scripting additions extend AppleScript's functionality by adding new commands and classes. To invoke a command from a scripting addition call it in the same way as the built-in commands. Good scripting additions contain a set of examples demonstrating the features of the scripting addition. The best way to understand what the addition can do is to go through the included sample scripts. Simply open the script in your favorite script editor, and follow the inline instructions to customize the code and test how your changes affect the script's behavior.
The commands defined by a scripting addition behave the same way as built-in ones. This means, among other things, that they are accessible globally, for each application. The developers of Mac OS X often use this fact and implement the global commands as scripting additions. Unfortunately, there are also drawbacks. When two different scripting additions define the same command, terminological conflicts appear and the additions may work incorrectly, or not at all. The designers of scripting additions try to avoid such situations, but sometimes it happens.
Fortunately, a simple workaround can be used to specify which scripting addition you want to use commands from. The command which could cause such conflict must be placed inside of a block "using terms from application","end using terms from". The following example demonstrates this. Note that the full path to the addition must be entered.
using terms from application "Macintosh HD:Users:Jose:Library:ScriptingAdditions:24u Appearance OSAX.osax" display alert "Hi!" end using terms fromIf you want your solution not to be dependent on an absolute path to the scripting additions folder, you can use terminology from Finder. This is usually sufficient solution, because most developers trying at least not to have terminological conflicts with Finder.
using terms from application "Finder" display alert "Hi!" end using terms from
If you need help with a specific scripting addition, you should ask the scripting addition's vendor for support. If you need help with a scripting addition from 24U Software, start by looking in the documentation which accompanies the scripting addition. If the documentation does not answer your question, please go to our product support
page.